package com.kfm.hotel.controller;

import com.kfm.hotel.domain.Demo;
import com.kfm.hotel.util.R;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping("/demo")
public class DemoController {


    @GetMapping
    public ModelAndView index() {
        ModelAndView modelAndView = new ModelAndView("demo");
        return modelAndView;
    }

    @PostMapping("/save")
    public R save(@RequestBody Demo str) {
        // str --> json --> Demo
        return R.ok("保存成功");
    }
}
